<?php

goto pogrI;
X8ejA:
pdo_update('core_paylog', array('openid' => $_W['openid'], 'tag' => iserializer(array('acid' => $_W['acid'], 'uid' => $_W['member']['uid']))), array('plid' => $paylog['plid']));
goto eqEWS;
NvQyC:
wXUMX:
goto oOSsL;
TxvuE:
$giftdata = array('rid' => $rid, 'tid' => $id, 'uniacid' => $_W['uniacid'], 'oauth_openid' => $userinfo['oauth_openid'], 'openid' => $userinfo['openid'], 'avatar' => $userinfo['avatar'], 'nickname' => $userinfo['nickname'], 'user_ip' => $_W['clientip'], 'gifticon' => $gift['gifticon'], 'giftcount' => $count, 'gifttitle' => $gift['gifttitle'], 'giftvote' => $gift['giftvote'] * $count, 'fee' => $params['fee'], 'ptid' => $tid, 'ispay' => 0, 'status' => 0, 'jy' => $_GPC['jy'], 'createtime' => time());
goto PYETX;
UCQa_:
D7dzJ:
goto njLoW;
Gs8X7:
$tid = date('YmdHi') . random(12, 1);
goto ToryT;
PYETX:
$gMhP4 = !pdo_insert($this->tablegift, $giftdata);
goto qb_Vo;
wTV7l:
aMdsA:
goto qiKZV;
kmFMk:
$condition .= ' AND status=1 ';
goto RKI8K;
hgkkH:
$gift = $giftdata[$_GPC['giftid']];
goto DDFQX;
h4g3S:
$wechat_payment['secret'] = $account['secret'];
goto AwHZ9;
rsu5v:
$count = intval($_GPC['count']);
goto ami4t;
Z3aTX:
if ($reply['voteendtime'] < time()) {
    goto rG5kF;
}
goto uB2Wy;
FDHKH:
$lLXic = !empty($reply['status']);
goto rEt0b;
DbwD8:
suSj0:
goto NuLw7;
zWJYw:
die(json_encode(array('error' => '1', 'msg' => '无法获取OPNEID，请查看是否借权或配置好公众号！(0101)')));
goto E345O;
m1ZWj:
global $_W, $_GPC;
goto LK668;
qEp_G:
$rid = intval($_GPC['rid']);
goto DG3Ih;
aYDwq:
$reply = pdo_fetch('SELECT rid,title,sharetitle,shareimg,sharedesc,config,giftdata,starttime,endtime,apstarttime,apendtime,votestarttime,voteendtime,status  FROM ' . tablename($this->tablereply) . ' WHERE rid = :rid ', array(':rid' => $rid));
goto Hsj0Q;
IBi1g:
$userinfo = $this->oauthuser;
goto ZmpXx;
njLoW:
$aXeW_ = !(!empty($paylog) && $paylog['status'] != '0');
goto dJWmo;
I0oMI:
$og0hB = !($gift['giftprice'] * $count > $diamondsy && !empty($reply['everyonediamond']));
goto UTWlN;
KzRsP:
goto Up9sZ;
goto wTV7l;
xNn2g:
if ($zq7q_) {
    goto aTIew;
}
goto Db1gE;
P1Igo:
if ($reply['votestarttime'] > time()) {
    goto ylFB8;
}
goto Z3aTX;
b4iLT:
$voteuser = pdo_fetch('SELECT * FROM ' . tablename($this->tablevoteuser) . ' WHERE rid = :rid AND  id = :id ', array(':rid' => $rid, ':id' => $id));
goto ea_s9;
MEos9:
$paylog['title'] = $getparams['title'];
goto Yu3Hq;
tNFm2:
die(json_encode(array('error' => '1', 'msg' => '已结束投票！')));
goto DbwD8;
tfmQP:
goto suSj0;
goto ped4y;
qiKZV:
die(json_encode(array('error' => '1', 'msg' => '最多还能送' . $diamondsy . '元礼物，修改后再送！')));
goto yCmdO;
ZmpXx:
$oauth_openid = $userinfo['oauth_openid'];
goto qPnAT;
lL91U:
die(json_encode(array('error' => '1', 'msg' => '参数错误')));
goto NvQyC;
bvry9:
$setting = uni_setting($_W['uniacid'], array('payment'));
goto vmOoR;
ami4t:
$count = empty($count) ? 1 : $count;
goto IBi1g;
KCTHy:
if ($BYMSe) {
    goto HHDcG;
}
goto Nv9ub;
imPFe:
unset($reply['config']);
goto FDHKH;
WydX2:
die(json_encode(array('error' => '1', 'msg' => '活动还没有开始')));
goto ebC6l;
E345O:
VWJyv:
goto aYDwq;
sCWV2:
s9I1h:
goto n4y0c;
g0jFs:
if ($vyW3x) {
    goto VWJyv;
}
goto zWJYw;
o1u6V:
pdo_insert('core_paylog', $paylog);
goto UIHkZ;
u2BkI:
$paylog = pdo_get('core_paylog', array('uniacid' => $_W['uniacid'], 'module' => $getparams['module'], 'tid' => $getparams['tid']));
goto Aw_Zu;
rEt0b:
if ($lLXic) {
    goto zaukj;
}
goto UQMGi;
ToryT:
$params = array('tid' => $tid, 'ordersn' => $tid, 'title' => '投票送礼付款', 'fee' => sprintf('%.2f', $gift['giftprice'] * $count), 'user' => $_W['member']['uid'], 'module' => $this->module['name']);
goto TxvuE;
eFQ6n:
$moduleid = empty($moduleid) ? '000000' : sprintf('%06d', $moduleid);
goto bjGiC;
SiQ9o:
$tqT2Q = !($reply['ischecked'] == 1);
goto KYjTB;
kIzjY:
$wechat_payment_params = wechat_build($params_b, $wechat_payment);
goto OyTfo;
qPjd5:
$condition = '';
goto SiQ9o;
o7qya:
xA_57:
goto Gs8X7;
Hsj0Q:
$reply = array_merge($reply, unserialize($reply['config']));
goto imPFe;
I_Vjp:
die(json_encode(array('error' => '1', 'msg' => '未开始投票！')));
goto tfmQP;
UTWlN:
if ($og0hB) {
    goto xA_57;
}
goto CpNM8;
ped4y:
rG5kF:
goto tNFm2;
j_993:
if ($W_GVw) {
    goto wXUMX;
}
goto lL91U;
yCmdO:
Up9sZ:
goto o7qya;
UQMGi:
die(json_encode(array('error' => '1', 'msg' => '活动已禁用')));
goto wNgku;
IWWnA:
message(error(0, $wechat_payment_params), '', 'ajax', false);
goto AtPyk;
ExIo3:
die(json_encode(array('error' => '1', 'msg' => '活动已禁用')));
goto Ats8T;
qb_Vo:
if ($gMhP4) {
    goto b5eDr;
}
goto IGhJP;
f46Tm:
if ($t8w1D) {
    goto LjF53;
}
goto WydX2;
YKaxW:
$wechat_payment_params = wechat_proxy_build($params_b, $wechat_payment);
goto sCWV2;
AwHZ9:
$params_b = array('tid' => $paylog['tid'], 'fee' => $paylog['card_fee'], 'user' => $paylog['openid'], 'title' => urldecode($paylog['title']), 'uniontid' => $paylog['uniontid']);
goto lFoTU;
n4y0c:
if (is_error($wechat_payment_params)) {
    goto olDhd;
}
goto IWWnA;
ik8xt:
die(json_encode(array('error' => '1', 'msg' => '最多能送' . $reply['everyonediamond'] . '元礼物，给其他人点机会吧！')));
goto KzRsP;
XJChU:
$zq7q_ = !($reply['endtime'] < time());
goto xNn2g;
ebC6l:
LjF53:
goto XJChU;
DG3Ih:
$id = intval($_GPC['id']);
goto knVzn;
n0Byp:
$moduleid = pdo_getcolumn('modules', array('name' => $getparams['module']), 'mid');
goto eFQ6n;
OyTfo:
goto s9I1h;
goto ZyFaq;
enwCn:
HHDcG:
goto UXxmY;
IGhJP:
$getparams = array('method' => 'wechat', 'tid' => $tid, 'title' => '支付' . $params['fee'] . '元', 'fee' => $params['fee'], 'module' => 'tyzm_diamondvote');
goto n0Byp;
aUgPP:
if ($t_9SB) {
    goto WkSzo;
}
goto qPjd5;
EaWwc:
tj6eM:
goto MEos9;
aZtLP:
message(error(1, $wechat_payment_params), '', 'ajax', false);
goto O4JLh;
knVzn:
$ty = $_GPC['ty'];
goto rsu5v;
eqEWS:
$_W['uniacid'] = $paylog['uniacid'];
goto aQmkq;
pogrI:
define('IN_MOBILE', true);
goto m1ZWj;
KZxkG:
l4Ib6:
goto tpYhM;
sDhH6:
die(json_encode(array('error' => '1', 'msg' => '这个订单已经支付成功, 不需要重复支付.')));
goto KZxkG;
Db1gE:
die(json_encode(array('error' => '1', 'msg' => '活动已经结束')));
goto Hr8RG;
Aw_Zu:
$s9sTk = !empty($paylog);
goto b2Crm;
iNe8w:
$lLXic = !empty($reply['status']);
goto jEkDX;
KYjTB:
if ($tqT2Q) {
    goto zz3ja;
}
goto kmFMk;
t9d9Z:
if (intval($wechat_payment['switch']) == 2 || intval($wechat_payment['switch']) == 3) {
    goto Lysl5;
}
goto lViqW;
vmOoR:
$wechat_payment = $setting['payment']['wechat'];
goto vAURB;
lFoTU:
$wechat_payment['openid'] = $_SESSION['oauth_openid'];
goto t9d9Z;
Hr8RG:
aTIew:
goto iNe8w;
dJWmo:
if ($aXeW_) {
    goto l4Ib6;
}
goto sDhH6;
X6afz:
olDhd:
goto aZtLP;
bjGiC:
$uniontid = date('YmdHis') . $moduleid . random(8, 1);
goto u2BkI;
tpYhM:
$N1m9S = !(!empty($paylog) && empty($paylog['uniontid']));
goto IXkyQ;
UXxmY:
WkSzo:
goto hgkkH;
Eb6Xl:
$BYMSe = !($reply['minnumpeople'] > $jointotal);
goto KCTHy;
NuLw7:
$giftdata = @unserialize($reply['giftdata']);
goto b4iLT;
aQmkq:
$_W['openid'] = $paylog['openid'];
goto bvry9;
IXkyQ:
if ($N1m9S) {
    goto tj6eM;
}
goto uU680;
UIHkZ:
$paylog['plid'] = pdo_insertid();
goto UCQa_;
wNgku:
zaukj:
goto JB6av;
Nv9ub:
die(json_encode(array('error' => '1', 'msg' => '活动还未开始，没有达到最小参赛人数！')));
goto enwCn;
unisb:
$paylog = array('uniacid' => $_W['uniacid'], 'acid' => $_W['acid'], 'openid' => $userinfo['oauth_openid'], 'module' => $getparams['module'], 'tid' => $getparams['tid'], 'uniontid' => $uniontid, 'fee' => $getparams['fee'], 'card_fee' => $getparams['fee'], 'status' => '0', 'is_usecard' => '0');
goto o1u6V;
JB6av:
$W_GVw = !empty($reply);
goto j_993;
LcCTq:
ylFB8:
goto I_Vjp;
DDFQX:
$diamondsy = $reply['everyonediamond'] - $voteuser['giftcount'];
goto I0oMI;
CXiXN:
$wechat_payment['appid'] = $account['key'];
goto h4g3S;
ea_s9:
$t_9SB = empty($reply['minnumpeople']);
goto aUgPP;
Ats8T:
CdtB6:
goto P1Igo;
RKI8K:
zz3ja:
goto mcxZi;
CpNM8:
if ($diamondsy > 0) {
    goto aMdsA;
}
goto ik8xt;
oOSsL:
$t8w1D = !($reply['starttime'] > time());
goto f46Tm;
ZyFaq:
Lysl5:
goto YKaxW;
b2Crm:
if ($s9sTk) {
    goto D7dzJ;
}
goto unisb;
AtPyk:
goto MZ2yi;
goto X6afz;
lViqW:
unset($wechat_payment['sub_mch_id']);
goto kIzjY;
uB2Wy:
goto suSj0;
goto LcCTq;
qPnAT:
$vyW3x = !empty($oauth_openid);
goto g0jFs;
vAURB:
$account = pdo_get('account_wechats', array('acid' => $wechat_payment['account']), array('key', 'secret'));
goto CXiXN;
Yu3Hq:
load()->model('payment');
goto X8ejA;
mcxZi:
$jointotal = pdo_fetchcolumn('SELECT COUNT(id) FROM ' . tablename($this->tablevoteuser) . ' WHERE   rid = :rid  ' . $condition, array(':rid' => $rid));
goto Eb6Xl;
O4JLh:
MZ2yi:
goto Pv6SQ;
uU680:
pdo_update('core_paylog', array('uniontid' => $uniontid), array('plid' => $paylog['plid']));
goto EaWwc;
jEkDX:
if ($lLXic) {
    goto CdtB6;
}
goto ExIo3;
LK668:
is_weixin();
goto qEp_G;
Pv6SQ:
b5eDr: